﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using JumploaderWrapper;

public partial class PartitionSave : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        //same page process files
        if (Request.Files.Count > 0)
        {
            FileSystemFileSaver save = new FileSystemFileSaver(HttpContext.Current, "PartitionSave\\");
            MultUploadHandler handle = new MultUploadHandler(save);
            handle.ProcessRequest(HttpContext.Current);

            Response.End();
            return;
        }

        jload.AppletParams.Add("uc_partitionLength", "1048576"); //1 megabyte
        jload.AppletParams.Add("uc_maxFileLength", "262144000"); //250 Mb
        
        jload.LookAndFeel = JumploaderWrapper.JumploaderLookAndFeel.System;
        jload.FileTreeVisible = true;
        jload.FileListVisible = true;
        //jload.DirectoryEnabled = true;
        jload.Width = Unit.Percentage(100);
        jload.Height = 600;
        // jload.AppletParams.Add("vc_disableLocalFileSystem", "false");
        jload.AppletParams.Add("vc_uploadViewStartUploadButtonText", "Upload Files");
        jload.AppletParams.Add("vc_uploadViewStartUploadButtonImageUrl", "JumploaderResource.aspx?Resource=page_stack_go&Type=png");
        jload.AppletParams.Add("vc_uploadViewStopUploadButtonText", "Cancel Upload");
        jload.AppletParams.Add("vc_uploadViewStopUploadButtonImageUrl", "JumploaderResource.aspx?Resource=cancel&Type=png");
        jload.AppletParams.Add("vc_uploadViewStopActionVisible", "true");

        jload.AppletParams.Add("vc_mainViewShowUploadErrors", "true");
    }
}